{% extends 'base/base.html' %}
{% block cssjs %}
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/invite.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/Site.css' %}">
    <link rel="stylesheet" href="{% static 'css/SiteMenu.css' %}">
    <link rel="stylesheet" href="{% static 'css/SiteData.css' %}">
    <link rel="stylesheet" href="{% static 'layui/layui.css' %}">

{% endblock %}
{% block content %}
    <div class="content" style="margin-top: 75px;margin-bottom: 120px">
        <div class="Box10 ClearFloat">
            <div class="Box210 FloatLeft MarginLeft10">
                <div class="ListMenu">
                    <h2><span>&nbsp;&nbsp;&nbsp;&nbsp;农业科技机构数据库</span></h2>
                    <ul>
                        {% for db in databases %}
                            <li><a href="?type=agritech&select={{ db.id }}"  {% ifequal db.id  select %}class="Selected"{% endifequal %}>{{ db.title }}</a></li>
                        {% endfor %}

                    </ul>
                </div>
            </div>
        <div class="Box77 FloatLeft MarginLeft10">
            <div class="List">
                <h1 class="ListTitle">浏览全部数据<a href="{% url 'share' %}?category=4" onclick="ADataForm_Click();" target="_blank">批量下载数据</a></h1>
                <table class="TableBorder0">
                    <tbody>
                        <tr>
                            <td style="height:305px;vertical-align:top">
                                <table class="ListContent1 EllipsisTable">
                                        <tbody>
                                        <tr>
                                            <th style="width:40px;">id</th>
                                            {%  for field in display_fields %}
                                                <th>{{ field.content }}</th>
                                            {% endfor %}
                                        </tr>
                                        {% for item in items.object_list %}
                                        <tr>
                                            <td class="TextCenter" style="text-align: center">{{ forloop.counter }}</td>
                                            {% for content in item %}
                                                {% ifequal forloop.counter 2 %}
                                                    <td class="Pad_Left5 EllipsisTd" style="text-align: center;">
                                                        <a href="?type=agritech&select={{ select }}&index={{ item.0 }}"  style="padding-left: 10px;color: rgb(0, 0, 238)" title="{{ content }}">{{ content }} </a>
                                                    </td>
                                                {% else %}
                                                    {% ifnotequal forloop.counter 1 %}
                                                        <td class="Pad_Left5 EllipsisTd" title="{{ content }}" style="text-align: center;">{{ content }}</td>
                                                    {% endifnotequal %}
                                                {% endifequal %}
                                            {% endfor %}
                                        </tr>

                                    {% endfor %}

                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        <tr>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id="demo7" style="padding-left: 120px">
                <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-10">
                    <span class="layui-laypage-count">共{{ items_num }}条</span>
                    {% if items.has_previous %}
                        <a href="?{{ items.previous_page_number.querystring }}" class="prev layui-laypage-prev ">&lsaquo;&lsaquo; 上一页</a>
                    {% else %}
                        <span class="layui-disabled prev layui-laypage-prev">&lsaquo;&lsaquo; 上一页</span>
                    {% endif %}
                    {% for page in items.pages %}
                        {% if page %}
                            {% ifequal page items.number %}
                                <span class="layui-laypage-curr"><em class="layui-laypage-em"></em><em>{{ page }}</em></span>
                            {% else %}
                                <a href="?{{ page.querystring }}" class="page" data-page="{{ page }}">{{ page }}</a>
                            {% endifequal %}
                        {% else %}
                            <span class="layui-laypage-spr">…</span>
                        {% endif %}
                    {% endfor %}
                    {% if items.has_next %}
                        <a href="?{{ items.next_page_number.querystring }}" class="next layui-laypage-next" data-page="{{ items.next_page_number }}">下一页 &rsaquo;&rsaquo;</a>
                    {% else %}
                        <span class="disabled next">下一页 &rsaquo;&rsaquo;</span>
                    {% endif %}
                    <span class="layui-laypage-skip">到第<input id='inputpage' type="text" min="1" value="1" class="layui-input">页<button type="button" class="layui-laypage-btn">确定</button></span>
                    <script>
                        $("#demo7 .layui-laypage-btn").on("click", function () {
                            location.href = "?page=" + $("#inputpage").val()
                        })
                    </script>
                </div>
            </div>
        </div>
    </div>
    </div>

{% endblock %}

{% block foot %}
{% endblock %}

